package com.oren.system.mapper;

import com.oren.system.pojo.User;
import org.apache.ibatis.session.RowBounds;

import java.util.List;
import java.util.Map;

/**
 * @Author: oren
 * @Description:
 * @Date: Create on 2017/11/6 0006 17:18
 */
public interface UserMapper {

	/**
	 * 根据id返回数据
	 * @param username
	 * @return
	 * @throws Exception
	 */
	User getUserByUsername(String username)throws Exception;

	/**
	 * 查询所有的数据
	 * @return
	 * @throws Exception
	 */
	List<User> pageList(User user, RowBounds rowBounds)throws Exception;

	/**
	 * 分页查询总数
	 * @param user
	 * @return
	 * @throws Exception
	 */
	int total(User user)throws Exception;


	/**
	 * 添加数据
	 * @return
	 * @throws Exception
	 */
	int insertUser(User user)throws Exception;

	/**
	 * 根据用户名和密码查询
	 * @param params
	 * @return
	 * @throws Exception
	 */
	User findUserByUsernamePassword(Map params)throws Exception;

	/**
	 * 根据ids删除数据
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	int deleteById(String[] ids)throws Exception;

	/**
	 * 根据id查询数据
	 * @param id
	 * @return
	 */
	User getUserById(Integer id);

}
